﻿using System;
using System.Drawing;
using System.Windows.Forms;
using Kaleida.ServiceMonitor.Model;

namespace Kaleida.ServiceMonitor.UI
{
    public class StatusDisplay : ToolStripStatusLabel
    {
        private string fullMessage;

        public void SetMessage(string message, Color color)
        {
            fullMessage = message;
            Text = message.Abbreviate(200, "...\r\n[Click for full message]");
            ForeColor = color;
        }

        protected override void OnClick(EventArgs e)
        {
            MessageBox.Show(fullMessage, "Full Error Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
    }
}
